package org.ns.summer.beans.beanprocessor;

import org.ns.summer.beans.ConfigurableBeanFactory;
import org.ns.summer.beans.InitializingBeanPostProcessor;

public class BeanFactoryAwareProcessor implements InitializingBeanPostProcessor {
    @Override
    public void preHandler(ConfigurableBeanFactory beanFactory, Object bean, String beanName) {
        if (bean instanceof BeanFactoryAware) {
            ((BeanFactoryAware)bean).setBeanFactory(beanFactory);
        }
    }
}
